package mal.carbonization;

import java.util.List;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ItemDust extends Item {

	public ItemDust(int par1) {
		super(par1);
		this.hasSubtypes=true;
		this.setMaxDamage(0);
		this.setTextureFile(getTexture());
		this.setCreativeTab(CreativeTabs.tabMaterials);
	}

	public String getTexture()
	{
		return "/mal/carbonization/carbonizationTexture.png";
	}
	
	public int getIconFromDamage(int par1)
	{
		switch (par1)
		{
		case 0:
			return 38;
		case 1:
			return 32;
		case 2:
			return 33;
		case 3:
			return 34;
		case 4:
			return 35;
		case 5:
			return 38;
		case 6:
			return 36;
		case 7:
			return 37;
		case 8:
			return 38;
		default:
			return 0;
		}
	}
	
	public int getMetadata(int par1)
	{
		return par1;
	}
	
	/**
     * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
     */
	@SideOnly(Side.CLIENT)
    public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
    {
        par3List.add(new ItemStack(par1, 1, 0));
        par3List.add(new ItemStack(par1, 1, 1));
        par3List.add(new ItemStack(par1, 1, 2));
        par3List.add(new ItemStack(par1, 1, 3));
        par3List.add(new ItemStack(par1, 1, 4));
        par3List.add(new ItemStack(par1, 1, 5));
        par3List.add(new ItemStack(par1, 1, 6));
        par3List.add(new ItemStack(par1, 1, 7));
        par3List.add(new ItemStack(par1, 1, 8));
    }
	
	public String getItemNameIS(ItemStack itemstack)
	{
		String name = "";
		switch (itemstack.getItemDamage())
		{
		case 0:
			name = "charcoaldust";
			break;
		case 1:
			name = "peatdust";
			break;
		case 2:
			name = "lignitedust";
			break;
		case 3:
			name = "sbitdust";
			break;
		case 4:
			name = "bitdust";
			break;
		case 5:
			name = "coaldust";
			break;
		case 6:
			name = "anthracitedust";
			break;
		case 7:
			name = "graphitedust";
			break;
		case 8:
			name = "acharcoaldust";
		default:
			name = "blaarg";
		}
		return getItemName() + "." + name;
	}
}
